/**
 * 
 */
package com.fyp.ptma.model;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author YahyaArshad
 * 
 */
@Entity
@XmlRootElement(name = "installation")
@XmlAccessorType(XmlAccessType.NONE)
public class Installation implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@XmlElement
	private InstallationPk installationPk;

	@EmbeddedId
	public InstallationPk getInstallationPk() {
		return installationPk;
	}

	public void setInstallationPk(InstallationPk installationPk) {
		this.installationPk = installationPk;
	}

	@XmlElement(required = false)
	private Downloader downloader;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(referencedColumnName = "id")
	public Downloader getDownloader() {
		return downloader;
	}

	public void setDownloader(Downloader downloader) {
		this.downloader = downloader;
	}

}
